<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<head>

<script>
	var registers = [];
</script>

<c:forEach items="${registers}" var="register">
	<script type="text/javascript">
		debugger;
		var register = {
			'seq': "${register.seq}",
			'patientName': "${register.patientName}",
			'type':"${register.type}",
			'reserveTime':"${register.reserveTime}",
			'registerTime':"${register.registerTime}"
		};
		registers.push(register);
	</script>
</c:forEach>

<script type="text/javascript">
	debugger;
	$(function() {
		dataGrid = $('#dataGrid').datagrid({
			striped : true,
			rownumbers : true,
			singleSelect : true,
			idField : 'doctorId',
			sortName : 'id',
			sortOrder : 'asc',
			columns :[[{
				width : '50',
				title : '排序号',
				field : 'seq'
			}, {
				width : '80',
				title : '病人',
				field : 'patientName'
			},{
				width : '100',
				title : '挂号方式',
				field : 'type',
				sortable : true,
				formatter : function(value, row, index) {
					switch (value) {
					case 1:
						return '现场挂号';
					case 0:
						return '预约挂号';
					}
				}
			},{
				width : '150',
				title : '预约时间',
				field : 'reserveTime'
			}, {
				width : '150',
				title : '挂号时间',
				field : 'registerTime'
			} ] ],
			data: registers,
		});
	});
</script>
</head>

<div class="easyui-layout" data-options="fit:true,border:false">
	<div data-options="region:'center',fit:true,border:false">
		<table id="dataGrid" data-options="fit:true,border:false"></table>
	</div>
</div>